package tianrun.ziguan.api.calculate.config.service.asset.module.impl;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import tianrun.ziguan.api.calculate.config.entity.TAssetIndicatorsModule;
import tianrun.ziguan.api.calculate.config.dao.TAssetIndicatorsModuleMapper;
import tianrun.ziguan.api.calculate.config.entity.TAssetStaticPropertiesModule;
import tianrun.ziguan.api.calculate.config.entity.TIndicatorsModule;
import tianrun.ziguan.api.calculate.config.service.asset.module.ITAssetIndicatorsModuleService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import tianrun.ziguan.api.calculate.config.utils.CollectionUtil;

import java.util.Collections;
import java.util.List;
import java.util.Set;

/**
 * @author zhaoqi
 */
@Service
public class TAssetIndicatorsModuleServiceImpl extends ServiceImpl<TAssetIndicatorsModuleMapper, TAssetIndicatorsModule> implements ITAssetIndicatorsModuleService {

    @Override
    public List<TAssetIndicatorsModule> getByCalAssetId(Set<Long> ids) {
        if (CollectionUtil.isEmpty(ids)) {
            return Collections.emptyList();
        }
        return list(Wrappers.<TAssetIndicatorsModule>lambdaQuery().in(TAssetIndicatorsModule::getCalAssetId, ids));
    }

    @Override
    public List<TAssetIndicatorsModule> getByCalAssetIds(Set<Long> assetId) {
        if (CollectionUtil.isEmpty(assetId))return Collections.emptyList();
        return list(Wrappers.<TAssetIndicatorsModule>lambdaQuery().in(TAssetIndicatorsModule::getCalAssetId,assetId));

    }
}
